let ajaxTimes=0
export const request=(params)=>{
    ajaxTimes++
    wx.showLoading({
      title: '加载中',
      mask:true
    })
    const baseUrl="https://mock.apifox.cn/m1/1975828-0-default";
    return new Promise((resolve, reject) => {
        // console.log("url",params);
        wx.request({
          url: baseUrl+params.url,
          success:res=>{
            resolve(res.data.message)
          },
          fail:err=>{
            reject(err)
          },
          complete:()=>{
            ajaxTimes--
            if(ajaxTimes==0){
                wx.hideLoading();
            }
          }
        })
    })
}